import axios from '../axios.js'

export const queryList = (data, ticket) => {
    return axios({
        url: '/online/resource/queryList',
        method: 'post',
        headers: {
            'ticket': ticket,
        },
        data
    });
};

export const resourceTotal = (ticket) => {
    return axios({
        url: '/online/resource/queryCount',
        method: 'get',
        headers: {
            'Content-Type': 'application/json;charset=UTF-8',
            'ticket': ticket,
        },
    });
};

export const resourceInfo = (data, ticket) => {
    return axios({
        url: '/online/resource/query/' + data,
        method: 'get',
        headers: {
            'ticket': ticket,
        },
        //data
    });
};

export const resourceDel = (data, ticket) => {
    return axios({
        url: '/online/resource/del',
        method: 'post',
        headers: {
            'ticket': ticket,
        },
        data
    });
};

export const resourceUpload = (data, ticket) => {
    return axios({
        url: '/online/resource/upload',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'multipart/form-data',
            'ticket': ticket,
        },
    });
};

export const resourcePlay = (data, ticket) => {
    return axios({
        url: '/online/resource/display/' + data,
        method: 'get',
        headers: {
            'ticket': ticket,
        },
        //data
    });
};

export const resourceDownload = (data, ticket) => {
    return axios({
        url: '/online/resource/download/' + data,
        method: 'get',
        responseType: 'blob',
        headers: {
            'ticket': ticket,
        },
        //data
    });
};

export const resourcePlayUrl = 'http://192.168.208.130:8082/online/resource/display';
export const resourceUploadUrl = "/online/resource/upload";